{# The model picker, in the modal: ONE list of the models this install can call, grouped by vendor and searched in one box; the recently used lead it. Kept quiet: teal means exactly one thing, the model in use, and says it once (the check). A search re-requests only the list. #} {% from "components/macros/icons.html" import icon %} {% from "components/macros/chat.html" import model_chip %} {% from "components/macros/layout.html" import avatar, dialog_title %} {# One section's rows: a pick posts the model id with the search, so the dialog re-renders in the same view. #} {% macro rows(section, picker) %} {% endmacro %} {% if chip_only %}{{ model_chip(chip, path) }}{% else %} {% if chip_oob %}{{ model_chip(chip, picker.path, oob=True) }}{% endif %}
{{ dialog_title("Models", "What the assistant runs on, for the whole app. A pick takes effect on the next message, or the next call.") }} {# Only the list moves: swapping the search box mid-keystroke takes the caret with it. #}
{% if picker.empty %}

No models match.

{% endif %} {% for section in picker.sections if section.rows %} {% if section.name %}
{{ avatar(section.name, section.icon_url, size="lg") }} {{ section.name }} {{ section.count }} {{ icon("chevron-down", "w-4 h-4 text-aegis-muted transition-transform group-open:rotate-180", 2) }} {{ rows(section, picker) }}
{% else %}
{{ rows(section, picker) }}
{% endif %} {% endfor %}
{% endif %}